//引入封装好的接口
import {memberlist} from '../../../request/api'
 const state = {
    memberlist:[]
}

const getters = {
    getMemberList(state){ 
        return state.memberlist
    }
}

const mutations = {
    REQ_MEMBERLIST(state,payload){
        state.memberlist = payload
    }
}

const actions = {
    //封装一个获取菜单列表的行动
    getMemberAction({commit}){
        // console.log('被触发');
        //调用接口
        memberlist().then(res=>{
            console.log(res,'仓库菜单列表'); 
            commit('REQ_MEMBERLIST',res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    //命名空间 为了给gettersgetters, mutations,actions 模块前面添加模块名 防止冲突
    namespaced:true
}